import Vue from 'vue'
import VueRouter, { RouteConfig } from 'vue-router'

Vue.use(VueRouter)

const routes: Array<RouteConfig> = [
    {
        path: '/',
        name: 'home',
        component: () => import('views/main-container.vue'),
        children: [
            {
                path: '/audit',
                name: 'audit',
                component: () => import('components/audit/audit.vue')
            },
            {
                path: '/employee',
                name: 'employee',
                component: () =>
                    import('components/organization/organization-content.vue')
            }
        ]
    },
    {
        path: '/login',
        name: 'login',
        component: () => import('views/login-page.vue'),
        meta: { hidden: true }
    }
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
